<HTML>
<HEAD>
<TITLE>JavaScript Source Code 2002:  Cookie Scripts</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 2002" CONTENT = "no-cache">
<META NAME="date" CONTENT="2000-09-09">
<META NAME="channel" CONTENT="Web Developer">
<META NAME="author" CONTENT="JavaScript Source Code 2002">
<META NAME="section" CONTENT="Cookies">
<META NAME="description" CONTENT="JavaScript Cookies -- These scripts all use JavaScript Cookies.   Cookies are small bits of information such as a name, a date, an order, etc.  Web pages can set cookies on a user's system and later retrieve them.  They are becoming increasingly common in personal web pages to track repeat visits.">
<meta name="keywords" content="cookie data user name date number of repeat visits favorite color last visit browser info">
<meta name="ROBOTS" content="ALL">
<meta name="title" content="JavaScript Source Code 2002 - Cookie Scripts">
<meta name="subject" content="JavaScript">
<LINK REL="stylesheet" href="../styles/jsstyles.css" /styles/jsstyles.css" type="text/css">
</HEAD>

<BODY>

<BR>

</CENTER>

<P CLASS="listingtxt">
These scripts all use JavaScript Cookies.   Cookies are small bits of information such as a name, a date, an order, etc.  Web pages can set cookies on a user's system and later retrieve them.  They are becoming increasingly common in personal web pages to track repeat visits.  These are the most difficult scripts to write - just look at the code.  
<hr noshade size=5 class="listing"></P>

</CENTER>
<!--content_start-->

<P CLASS="listingtxt">
<b>Title:</b> <a name="Address_Book" href="address-book.html" /cookies/address-book.html">Address Book</a><br><b>Contributor:</b>  <a href="mailto:joe@wdrealty.com">Joe Norman</a>  (<a href="mailto:joe@wdrealty.com">joe@wdrealty.com</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://www.jacksonville.net/~joman/ArraysNCookies.html  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.jacksonville.net/~joman/ArraysNCookies.html'" tppabs="http://www.jacksonville.net/~joman/ArraysNCookies.html">http://www.jacksonville.net/~joman/ArraysNCookies.html</a><br><b>Details:</b> 6.01 KB * Uploaded June 6 2000<br><b>Description:</b>  Saves an address book database as a cookie on the user's computer.  The author explains that although the actual example may not be particularly useful, the underlying code could be very beneficial for use in other projects.</P><P CLASS="listingalign" align=right>[ <a href="address-book.html#source" /cookies/address-book.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Bookmark_Reminder" href="bookmark-reminder.html" /cookies/bookmark-reminder.html">Bookmark Reminder</a><br><b>Contributor:</b>  <a href="mailto:webmaster@troop321.org">Dan Kirkpatrick</a>  (<a href="mailto:webmaster@troop321.org">webmaster@troop321.org</a>)<br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://www.troop-321.8m.com/html  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.troop-321.8m.com/html'" tppabs="http://www.troop-321.8m.com/html">http://www.troop-321.8m.com/html</a><br><b>Details:</b> 2.75 KB * Uploaded June 22 2000<br><b>Description:</b>  (Best with Internet Explorer)  Pops up the "Add to Favorites" bookmark window once a week, or after every certain number of days.  Netscape users are given an alert message to remind them to bookmark the site.</P><P CLASS="listingalign" align=right>[ <a href="bookmark-reminder.html#source" /cookies/bookmark-reminder.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="favoritebg" href="favorite-bg.html" /cookies/favorite-bg.html">Favorite Background</a><BR><b>Details:</b> 2.55 KB * Uploaded June 30 1997<br><b>Description:</b>  Let a JavaScript cookie remember your favorite background color.  On future visits, it automatically displays that background color for you.</P><P CLASS="listingalign" align=right>[ <a href="favorite-bg.html#source" /cookies/favorite-bg.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Cookie_Redirect" href="cookie-redirect.html" /cookies/cookie-redirect.html">Cookie Redirect</a><br><b>Contributor:</b>  Ronnie T. Moore, Editor  <br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://javascript.internet.com/cookies/JavaScript Source Code 2002  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?'))window.location='http://javascript.internet.com/cookies/JavaScript Source Code 2002'" /cookies/JavaScript Source Code 2002">JavaScript Source Code 2002</a><br><b>Details:</b> 2.91 KB * Uploaded May 11 2000<br><b>Description:</b>  Redirects the visitor to different pages based on the value of a stored cookie.  If no cookie is found, the available items are displayed for the user to pick from, which sets a cookie for their next visit.  Our demonstration uses a 'favorite animal' cookie, but this could easily be modified to fit your needs.</P><P CLASS="listingalign" align=right>[ <a href="cookie-redirect.html#source" /cookies/cookie-redirect.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="ID_Tracker" href="id-tracker.html" /cookies/id-tracker.html">ID Tracker</a><br><b>Contributor:</b>  Ronnie T. Moore, Editor  <br><b>Contributor URL:</b>&nbsp;<a href="javascript:if(confirm('http://javascript.internet.com/cookies/JavaScript Source Code 2002  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?'))window.location='http://javascript.internet.com/cookies/JavaScript Source Code 2002'" /cookies/JavaScript Source Code 2002">JavaScript Source Code 2002</a><br><b>Details:</b> 2.53 KB * Uploaded May 19 2000<br><b>Description:</b>  Allows you to save a visitor's referral ID in a cookie ID on their computer.  Then, you can you can access that ID cookie from the rest of your site.  Useful to help you pay affiliate commissions or track web site referrals.  Easy!</P><P CLASS="listingalign" align=right>[ <a href="id-tracker.html#source" /cookies/id-tracker.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="name" href="name.html" /cookies/name.html">User Name</a><BR><b>Details:</b> 3.19 KB * Uploaded July 1 1997<br><b>Description:</b>  Cookies allow web pages to store information on the visitors computer and to later retrieve that information.  This cookie records the visitor's name.</P><P CLASS="listingalign" align=right>[ <a href="name.html#source" /cookies/name.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="visits" href="visits.html" /cookies/visits.html">Number Of Visits</a><BR><b>Details:</b> 2.31 KB * Uploaded July 1 1997<br><b>Description:</b>  This cookies records how many times the visitor has visited the page and writes to the page accordingly.  (ie:  You have been here 2 times).</P><P CLASS="listingalign" align=right>[ <a href="visits.html#source" /cookies/visits.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="n-browser" href="n-browser.html" /cookies/n-browser.html">Name - Browser Info</a><BR><b>Details:</b> 2.75 KB * Uploaded June 30 1997<br><b>Description:</b>  This cookies records the visitor's name and also writes the visitor's browser information to the screen.</P><P CLASS="listingalign" align=right>[ <a href="n-browser.html#source" /cookies/n-browser.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="n-v-lv-alert" href="n-v-lv-alert.html" /cookies/n-v-lv-alert.html">Name - Visits - Last Visit</a><BR><b>Details:</b> 3.42 KB * Uploaded June 30 1997<br><b>Description:</b>  This cookies records the visitor's name, how many visits, and the last visit.</P><P CLASS="listingalign" align=right>[ <a href="n-v-lv-alert.html#source" /cookies/n-v-lv-alert.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>


<P CLASS="listingtxt">
<b>Title:</b> <a name="n-v-message" href="n-v-msg.html" /cookies/n-v-msg.html">Name - Visits - Message</a><BR><b>Details:</b> 3.32 KB * Uploaded June 30 1997<br><b>Description:</b>  This cookie records the visitor's name, how many visits, and displays a message depending on how many visits have been recorded.</P><P CLASS="listingalign" align=right>[ <a href="n-v-msg.html#source" /cookies/n-v-msg.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

<P CLASS="listingtxt">
<b>Title:</b> <a name="Only_Popup_Once" href="only-popup-once.html" /cookies/only-popup-once.html">Only Popup Once</a><br><b>Details:</b> 2.58 KB * Uploaded September 3 1999<br><b>Description:</b>  If you have a new window open up on your home page, it opens every time your visitors come back to that page.  This is rude as well as very annoying thing to force onto your visitors.  But, using cookies, this script can determine if the visitor has been here before, and only open a new window on their first visit to the page.  The next time they come back, the script will read the cookie, identify them as a repeat visitor, and NOT open the window again.  Neat!</P><P CLASS="listingalign" align=right>[ <a href="only-popup-once.html#source" /cookies/only-popup-once.html#source">Get Source Code</a> ]
<hr noshade size=5 class="listing"></P>

</FONT>
</CENTER>

</CENTER>
